package com.youseu.taoliving.commodity.config;

import com.baomidou.mybatisplus.extension.plugins.PaginationInterceptor;
import org.mybatis.spring.annotation.MapperScan;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;
import org.springframework.transaction.annotation.EnableTransactionManagement;

/**
 * @author Tao
 * @version 1.0
 * 分页插件 直接扫描dao包注入
 */
@Configuration
@MapperScan("com.youseu.taoliving.commodity.dao")
@EnableTransactionManagement
public class MybatisConfig {
    @Bean
    public PaginationInterceptor paginationInterceptor(){
        PaginationInterceptor paginationInterceptor = new PaginationInterceptor();
        //溢出设置为第一页
        paginationInterceptor.setOverflow(false);
        //单页不超过100
        paginationInterceptor.setLimit(100);
        return paginationInterceptor;
    }

}
